package main

import "fmt"

type calc func(int, int) int

func add(a int, b int) int {
	return a + b
}

func sub(a, b int) int {
	return a - b
}

func test(x, y int, calc calc) int {
	return calc(x, y)
}

func main() {
	i := test(22, 2, add)
	i2 := test(22, 2, sub)
	i3 := test(22, 2, func(a, b int) int {
		return a * b
	})
	fmt.Println(i, i2, i3)
}
